package com.bigdata.spark.util

import java.io.InputStreamReader
import java.util.Properties

/**
 * @author Gerry chan
 * @version 1.0
 * 2021/01/03
 * 需求1-功能实现 黑名单判断
 * https://www.bilibili.com/video/BV11A411L7CK?p=203
 */
object PropertiesUtil {
  /**
   * 获取配置文件
   * @param propertiesName
   * @return
   */
  def load(propertiesName:String):Properties = {
    val prop = new Properties()
    prop.load(new InputStreamReader(
      Thread.currentThread().getContextClassLoader.getResourceAsStream(propertiesName), "UTF-8")
    )
    prop
  }
}
